/*#include <stdio.h>
#include <freertos/FreeRTOS.h>
#include <freertos/task.h>
#include "simple_wifi_sta.h"
#include "nvs_flash.h"
#include "nvs.h"

#include <string.h>
#include <driver/rmt_rx.h>
#include <driver/rmt_tx.h>
#include <soc/rmt_reg.h>
#include "driver/gpio.h" 
#include <esp_log.h>
#include <freertos/queue.h>
#include "rom/ets_sys.h"
*/

#include <stdio.h>
#include "esp_system.h"
#include "esp_spi_flash.h"
#include "esp_wifi.h"
#include "esp_event_loop.h"
#include "esp_log.h"
#include "esp_err.h"
#include "nvs_flash.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "driver/ledc.h"
#include <stdio.h>
#include "driver/uart.h"
#include "driver/gpio.h"
#include "string.h"
#include "Lcd.h"
#include "dht11.h"

#include "simple_wifi_sta.h"



void app_main(void)
{
    //NVS初始化（WIFI底层驱动有用到NVS，所以这里要初始化）
    nvs_flash_init();
    //wifi STA工作模式初始化
    wifi_sta_init();

    char dht11_buff[50]={0};

    //��ʾ����ʼ��
    Lcd_Init();

    //��ʾ����ʾ��Ϣ
    Gui_DrawFont_GBK24(15,0,RED,WHITE,(u8 *)"ITImotor");
    //LCD_P6x8Str(20,24,WHITE,BLACK,(u8 *)"sz-yy.taobao.com");
    Gui_DrawFont_GBK16(16,34,VIOLET,WHITE,(u8 *)"iti");
    Gui_DrawFont_GBK16(32,50,BLUE,WHITE,(u8 *)"welcome");
    Gui_DrawFont_GBK16(20,70,RED,WHITE,(u8 *)"TFTLCD");

    while(1)
    {
      DHT11(); //��ȡ��ʪ��
      //sprintf(dht11_buff, "   �¶�=%d��   ", wendu);
      sprintf(dht11_buff, "temp=%d度", wendu);
      Gui_DrawFont_GBK16(6,90,VIOLET,BLACK,(u8 *)dht11_buff);

      //sprintf(dht11_buff, "   ʪ��=%d%%    ", shidu);
      sprintf(dht11_buff, "hump=%d%%", shidu);
      Gui_DrawFont_GBK16(6,110,VIOLET,BLACK,(u8 *)dht11_buff);

      printf("T=%d,H=%d %%.\r\n", wendu, shidu);
      vTaskDelay(300);

      //vTaskDelay(pdMS_TO_TICKS(500));
    }
}
